<form action="/admin/pro/edit?id={{$info['id']}}" id="product-edit-form" data-toggle="ajaxform" data-alertmsg="false" data-options="{callback:close_product_edit_form}">
    <input type="hidden" name="id" value="{{$info['id']}}">
    <div class="bjui-row col-2">
        <div class="bjui-row col-2">
            <label class="row-label">成品、材料名称</label>
            <div class="row-input">
                <input type="text" name="product_name" value="{{$info['product_name']}}" placeholder="成品、材料名称">
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">产品编号</label>
            <div class="row-input required">
                <input type="text" name="product_no" value="{{$info['product_no']}}" id="product_no">
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">分类</label>
            <div class="row-input required">
                <select name="category_id" id="category_id" data-toggle="selectpicker" data-rule="required">
                    <option value="">全部</option>
                    @foreach ($catelist as $key => $value)
                        <option value="{{ $key }}" @if($key == $info['category_id']) selected @endif >{{ $value }}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">工艺图片</label>
            <div class="row-input">
                <input type="file" data-name="img_id" data-id="img_id" data-toggle="webuploader" data-options="
                {
                    pick: {label: '点击选择图片'},
                    server: 'admin/photo/upload',
                    upname:'img_id',
                    fileNumLimit: 5,
                    formData: {_token : '{{ csrf_token() }}',path_type:3},
                    required: true,
                    uploaded: '{{$info['img_url']}}',
                    initUploaded: '{{$info['img_id']}}',
                    basePath: '',
                    accept: {
                        title: '图片',
                        extensions: 'jpg,png',
                        mimeTypes: '.jpg,.png'
                    }
                }">
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">单价</label>
            <div class="row-input">
                <input type="text" name="price" id="price" value="{{$info['price']}}" size="">
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">数量</label>
            <div class="row-input">
                <input type="text" name="number" id="number" value="{{$info['number']}}" size="" readonly disabled>
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">预警数量</label>
            <div class="row-input">
                <input type="text" name="warning_number" id="warning_number" value="{{$info['warning_number']}}">
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">充足数量</label>
            <div class="row-input">
                <input type="text" name="full_number" id="full_number" value="{{$info['full_number']}}">
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">公共材料</label>
            <div class="row-input">
                <select name="is_public" id="is_public" data-toggle="selectpicker" data-rule="required">
                    <option value="yes" @if($info['is_public'] == 'yes') selected @endif>是</option>
                    <option value="no" @if($info['is_public'] == 'no') selected @endif>否</option>
                </select>
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label">单位</label>
            <div class="row-input required">
                <select name="unit" id="unit" data-toggle="selectpicker" data-rule="required">
                    @foreach ($units as $line)
                        <option value="{{ $line['value'] }}" @if($line['value'] == $info['unit']) selected @endif >{{ $line['value'] }}</option>
                    @endforeach
                </select>
            </div>
        </div>
        <div class="bjui-row col-2">
            <label class="row-label"></label>
            <div class="row-input">
                <button type="submit" class="btn-default" data-icon="save">保存</button>
                <button type="button" class="btn-close" data-icon="close">取消</button>
            </div>
        </div>
    </div>
</form>
<script>
    function close_product_edit_form(){
        BJUI.dialog('closeCurrent')
//        BJUI.navtab('refresh','order-type');
    }
</script>
